home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / backup / tob-0.13 / tob-0 / tob / doc / filemarks.doc < prev    next >
Text File  |  1995-03-07  |  2KB  |  60 lines

  1. A short introduction to file marks:
  2. ===================================
  3.  
  4.   File marks are written to tape to separate individual files (Note
  5. that one `tar' file may contain many data files!). So several
  6. files can be written to tape and individually retrieved.
  7.   The way ftape implements these file marks allows almost random
  8. access to individual files (instead of sequentially reading the
  9. entire tape until ones finds the right file mark).
  10.  
  11.   Every time the device is closed after writing some data two file
  12. marks are written to tape. If the non-rewinding device is used the
  13. tape is rewound so it is positioned right between these two marks.
  14.   If another file is written to tape the second marks is overwritten
  15. but the first stays causing succeeding files to be separated by
  16. exactly one file mark.
  17.  
  18.   The following should make this clear: After writing one file to the
  19. non-rewinding tape device the tape layout will be:
  20.  
  21.         <file-1> <eof> <eof>
  22.  
  23.   When another file is written the layout will be:
  24.  
  25.         <file 1> <eof> <file 2> <eof> <eof>
  26.  
  27.  
  28.   If we want to add another file to this tape after it has been
  29. rewound, there are to options: First to skip 2 file marks to position
  30. right between the last two marks. In this case we have to know how
  31. many files to skip.
  32.   The other solution is to seek for the double file mark and position
  33. in between. This is done with `mt eom'.
  34.   Remember to use the non-rewinding device when positioning the tape
  35. or it will be rewound when closing !
  36.  
  37.   Appending a file to a tape:
  38.  
  39.         mt -f /dev/nftape eom
  40.         tar cvf /dev/ftape <files>
  41.  
  42.   Reading the first and third files from tape:
  43.  
  44.         mt -f /dev/ftape rewind
  45.         tar xvf /dev/nftape
  46.         mt -f /dev/nftape fsf 2
  47.         tar xvf /dev/nftape
  48.  
  49.   The best way to understand what is happening is to picture the tape
  50. layout and count the file marks that have to be skipped.
  51.  
  52.  
  53. BTW: Keep in mind that file marks aren't written to tape until the
  54.      header segment is updated. For non-rewinding devices this will
  55. not happen automatically: Make sure that either the last write is to
  56. a rewinding device or issue an `mt rewind' or `mt rewoffl' to flush
  57. the buffers. The last command will put the drive offline until you
  58. reload the cartridge (or the driver). While the drive is offline all
  59. commands will fail.
  60.